<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition>
	<h:panelGrid id="supplierProductInputPanel" columns="1"
		style="width:100%">
		<p:separator/>
		<p:commandButton oncomplete="productDlg.show()" ajax="true"
			update=":dialogForm,:headerForm" icon="add"
			actionListener="#{productController.init}" value="Add"
			title="Add Product" style="float:left"></p:commandButton>
		<p:dataTable var="product" value="#{supplierModel.current.products}"
			rows="20">
			<f:facet name="header">List of products</f:facet>
			<p:column style="width:20px">
				<f:facet name="header">
					<p:commandButton icon="delete" ajax="true" update=":detailForm"
						style="float:right"
						actionListener="#{supplierController.removeSelectedProductsFromCurrent}"></p:commandButton>
				</f:facet>
				<p:selectBooleanCheckbox value="#{product.selected}"></p:selectBooleanCheckbox>
			</p:column>
			<p:column headerText="id" sortBy="#{product.id}"
				filterBy="#{product.id}" filterMatchMode="contains">
				<h:outputText value="#{product.id}" />
			</p:column>
			<p:column headerText="number" sortBy="#{product.number}"
				filterBy="#{product.number}" filterMatchMode="contains">
				<h:graphicImage library="images" value="../#{product.icon}16.png"></h:graphicImage>
				<h:outputText value="#{product.number}" />
			</p:column>
			<p:column headerText="name" sortBy="#{product.name}"
				filterBy="#{product.name}" filterMatchMode="contains">
				<h:outputText value="#{product.name}" />
			</p:column>
			<p:column headerText="price" sortBy="#{product.price}"
				filterBy="#{product.price}" filterMatchMode="contains">
				<h:outputText value="#{product.price}" />
			</p:column>
			<p:column headerText="inventory" sortBy="#{product.inventory}"
				filterBy="#{product.inventory}" filterMatchMode="contains">
				<h:outputText value="#{product.inventory}" />
			</p:column>
		</p:dataTable>
	</h:panelGrid>
</ui:composition>

</html>